#pragma once
#include "IUIDialog.h"
#include "DialogBase.h"
namespace inception
{
    typedef struct GuideCustomObserver : public DialogCustomObserver{
        virtual bool GetWindowStytle(DWORD& dwStytle, DWORD& dwExstytle){
            dwStytle = WS_POPUP;
            dwExstytle = /*WS_EX_TOPMOST & (~WS_EX_APPWINDOW) | */WS_EX_TOOLWINDOW;
            return true;
        };
        virtual bool GetRgn(HRGN& hRgn, RECT& rcWnd ){
            HRGN HRgnTop = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom - 7, 6, 6);
            POINT pt[3] = {
                { 15, rcWnd.bottom - 8 },
                { 22, rcWnd.bottom },
                { 30, rcWnd.bottom - 8 }
            };
            HRGN HRngArrow = ::CreatePolygonRgn(pt, 3, ALTERNATE );
            int nRet = CombineRgn( hRgn, HRgnTop, HRngArrow, RGN_OR);
            return true;
        };
    }GuideCustomObserver, * PGuideCustomObserver;

    using namespace UILib;
    class CVedioGuide : public CPageBase
                     , public ViewListener
    {
    public:
        enum{
            ID_Close = 1000,
        };
    public:
        CVedioGuide();
        virtual ~CVedioGuide();

        virtual void ShowPage( PageDataBase* pPageData );

        virtual void OnClick( const UINT uID );
    protected:
        void CreateWnd();

        void OnClose();

        static LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
        void OnTraceMove(UINT uMsg, WPARAM wParam, LPARAM lParam);
    private:
        IUIDialog*      pDialog_;
        PageDataGuide   guideData_;

        WNDPROC         oldWndPrpc_;
    };
}